﻿using System.ComponentModel.DataAnnotations.Schema;
using System.ComponentModel.DataAnnotations;

namespace MesProjectERP.Host.MesProjectERPDomain
{
    /// <summary>
    /// 客户实体
    /// </summary>
    [Table("ConsumerModel")]
    public class ConsumerModel:BaseEntity
    {
        /// <summary>
        ///客户管理id
        /// </summary>
        [Key]
        [Display(Name = "客户管理id")]
        [Column(TypeName = "int")]
        [Editable(true)]
        [Required(AllowEmptyStrings = false)]
        public int ConsumerId { get; set; }

        /// <summary>
        ///客户编码
        /// </summary>
        [Display(Name = "客户编码")]
        [MaxLength(50)]
        [Column(TypeName = "nvarchar(50)")]
        [Editable(true)]
        public string ConsumerCode { get; set; }

        /// <summary>
        ///客户名称
        /// </summary>
        [Display(Name = "客户名称")]
        [MaxLength(50)]
        [Column(TypeName = "nvarchar(50)")]
        [Editable(true)]
        public string ConsumerName { get; set; }

        /// <summary>
        ///简称
        /// </summary>
        [Display(Name = "简称")]
        [MaxLength(50)]
        [Column(TypeName = "nvarchar(50)")]
        [Editable(true)]
        public string ConsumerAbbreviation { get; set; }

        /// <summary>
        ///联系方式
        /// </summary>
        [Display(Name = "联系方式")]
        [MaxLength(11)]
        [Column(TypeName = "nvarchar(11)")]
        [Editable(true)]
        public string ConsumerPhone { get; set; }

        /// <summary>
        ///地址
        /// </summary>
        [Display(Name = "地址")]
        [MaxLength(200)]
        [Column(TypeName = "nvarchar(200)")]
        [Editable(true)]
        public string ConsumerAdress { get; set; }

        /// <summary>
        ///客户备注
        /// </summary>
        [Display(Name = "客户备注")]
        [MaxLength(200)]
        [Column(TypeName = "nvarchar(200)")]
        [Editable(true)]
        public string ConsumerRemarks { get; set; } = string.Empty;

        /// <summary>
        ///社会信用代码
        /// </summary>
        [Display(Name = "社会信用代码")]
        [MaxLength(200)]
        [Column(TypeName = "nvarchar(200)")]
        [Editable(true)]
        public string SocialCredit { get; set; } = string.Empty;

        /// <summary>
        ///创建人
        /// </summary>
        [Display(Name = "创建人")]
        [MaxLength(100)]
        [Column(TypeName = "nvarchar(100)")]
        [Editable(true)]
        public string CreateUserName { get; set; } = string.Empty;

        /// <summary>
        ///修改人
        /// </summary>
        [Display(Name = "修改人")]
        [MaxLength(100)]
        [Column(TypeName = "nvarchar(100)")]
        public string UpdateUserName { get; set; } = string.Empty;

        /// <summary>
        ///创建时间
        /// </summary>
        [Display(Name = "创建时间")]
        [Column(TypeName = "datetime")]
        public DateTime? CreateTime { get; set; }=DateTime.Now;

        /// <summary>
        ///更新时间
        /// </summary>
        [Display(Name = "更新时间")]
        [Column(TypeName = "datetime")]
        public DateTime? UpdateTime { get; set; }

        /// <summary>
        ///软删除
        /// </summary>
        [Display(Name = "软删除")]
        public bool IsDeleted { get; set; } = true;
    }
}
